# app.py - 专门用于打包的入口文件
import sys
import os

# 添加项目根目录到Python路径
project_root = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, project_root)

try:
    from ocr.ocr_engine import ScreenshotOCR
    from gui.main_window import OCRGUI
    
    def main():
        """主函数 - 启动图形界面"""
        # 创建OCR引擎
        ocr_engine = ScreenshotOCR()
        
        # 创建并运行GUI
        app = OCRGUI(ocr_engine)
        app.run()
        
    if __name__ == "__main__":
        main()
        
except ImportError as e:
    print(f"导入模块失败: {e}")
    input("按回车键退出...")
